/**
 *
 * Licensed Materials - Property of IBM 
 * 
 * OCO Source Materials 
 * 
 * (C) Copyright IBM Corp. 2011, 2012 All Rights Reserved 
 * 
 * The source code for this program is not published or other- 
 * wise divested of its trade secrets, irrespective of what has 
 * been deposited with the U.S. Copyright Office. 
 *
 */

/**
 * CHANGE HiSTORY:
 * Author             Time                 Description
 *
 */
package com.ibm.ba.demo.helper;

import java.util.ArrayList;
import java.util.Random;

public class RandomHelper {
	public static ArrayList<Integer> generateRandomIntList(int max, int num) {
		Random rnd = new Random();
		ArrayList<Integer> intList = new ArrayList<Integer>(num);
		for (int i = 0; i < num; i++) {
			int p = rnd.nextInt(max);
			if(intList.contains(p)) {
				i--;
			} else {
				intList.add(p);
			}
		}
		return intList;
	}
}
